package com.qqt.csr.common.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * @Author: yanghao
 * @Date: 2024/10/14 10:54
 * @Description: 删除枚举
 **/
@Getter
public enum DeletedEnum {

    NOT_DELETED(0, "未删除"),

    DELETED(1, "已删除")

    ;

    private final Integer code;

    private final String desc;

    DeletedEnum(final Integer code, final String desc){
        this.code = code;
        this.desc = desc;
    }

    public static final DeletedEnum[] ENUMS = DeletedEnum.values();

    public static DeletedEnum matchEnum(Integer value) {
        return Arrays.stream(values()).filter(ele -> Objects.equals(ele.code, value)).findFirst().orElse(null);
    }

}
